package org.jwcloud.project.module.zx.taskSupervision.service;

import com.jw.mid.mm.comm.common.json.Response;
import com.jw.mid.mm.comm.common.pagination.PageListSlice;
import com.jw.mid.mm.comm.common.pagination.Pagination;

import org.jwcloud.project.module.zx.common.FmtUtil;
import org.jwcloud.project.module.zx.common.Resp;
import org.jwcloud.project.module.zx.common.service.RptUtService;
import org.jwcloud.project.module.zx.taskSupervision.service.repository.TaskSuperviseRepository;
import org.jwcloud.project.module.zx.timingSz.service.repository.RptTimingSzRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TaskSuperviseServiceImpl implements TaskSuperviseService {

    @Autowired
    public TaskSuperviseRepository taskSuperviseRepository;

    @Autowired
    public RptUtService rptUtService;


    @Override
    public Resp<Response<PageListSlice>> queryTaskSupervise(Pagination pagination, Map param) {
    	FmtUtil.pagiBuild(pagination, param);
    	return Resp.success(rptUtService.findPagi(
                pagination,
                param,
                taskSuperviseRepository.queryTaskSuperviseListInfo(param),
                taskSuperviseRepository.queryTaskSuperviseListInfo_total(param)
        ));
    }

    @Override
    public Resp<Response<PageListSlice>> queryTaskOverTimeWarning(Pagination pagination, Map param) {
    	FmtUtil.pagiBuild(pagination, param);
    	return Resp.success(rptUtService.findPagi(
                pagination,
                param,
                taskSuperviseRepository.queryTaskOverTimeList(param),
                taskSuperviseRepository.queryTaskOverTimeListTotal(param)
        ));
    }

    @Override
    public Resp<Object> taskOvertimeFeedbackInfo(Map param) {
        return Resp.success(taskSuperviseRepository.taskOvertimeFeedback(param));
    }


}
